/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package researchgrants.parts.GrantRequest.filters;

import researchgrants.parts.GrantRequest.*;
import researchgrants.parts.pi.Pi;
import researchgrants.parts.pi.PisList;

/**
 * Filter out all elements, but the ones that contains a PI in the list of PIs whose id is given is piId.
 * @author ohad
 */
class GrantRequestFilterPi implements GrantRequestFilter {

    private int piId;
    
    GrantRequestFilterPi(int piId) {
        this.piId=piId;
    }

    public boolean isFiltered(GrantRequest grantRequest) {
        PisList pisList = grantRequest.getCurrentPis();
        return(!pisList.contains(Pi.getById(piId)));
    }

}
